﻿using System;

namespace Core.Entities.EQ
{
    /// <summary>
    /// 设备信息
    /// </summary>
    public class Device : BaseEntity<string>
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public override string? Id { get; set; }

        /// <summary>
        /// 设备编码
        /// </summary>
        public string? DevCode { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string? DevName { get; set; }

        /// <summary>
        /// 产线名称
        /// </summary>
        public string? ProductionLine { get; set; }

        /// <summary>
        /// 购入时间
        /// </summary>
        public DateTime? BuyTime { get; set; }

        /// <summary>
        /// 设备规格
        /// </summary>
        public string? DevSpec { get; set; }

        /// <summary>
        /// 设备状态
        /// </summary>
        public string? DevStatus { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDeleted { get; set; }

        /// <summary>
        /// 设备管理人
        /// </summary>
        public string? DevManager { get; set; }

        public Device()
        {
            // 如果ID为空，自动生成GUID
            if (string.IsNullOrEmpty(Id))
            {
                Id = Guid.NewGuid().ToString();
            }
        }
    }
}